package com.xch.sboot.persistence.domain.account;

import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * @author xch
 * 2022/7/20 20:58
 */
@Data
@Entity
@Table(name = "base_user")
@EntityListeners(AuditingEntityListener.class)
public class User {
    @Id
    @Column(columnDefinition = "varchar(26) not null comment '主键 id' ")
    private String id;

    @Column(columnDefinition = "varchar(12) comment '邮箱' ")
    private String username;

    @Column(columnDefinition = "varchar(10) comment '昵称' ")
    private String nickname;

    @Column(columnDefinition = "varchar(11) comment '手机' ")
    private String mobile;

    @Column(columnDefinition = "varchar(50) comment '邮箱' ")
    private String email;

    @Column(columnDefinition = "varchar(100) not null comment '密码' ")
    private String password;

    @Column(columnDefinition = "varchar(16) comment '加盐'")
    private String salt;

    @Column(columnDefinition = "datetime comment '创建时间' ")
    @CreatedDate
    private LocalDateTime createTime;

    @Column(columnDefinition = "datetime comment '更新时间'")
    @LastModifiedDate
    private LocalDateTime updateTime;

    @Column(columnDefinition = "tinyint(1) comment '删除标志' ")
    private boolean delFlag;
}
